<template>
  <div class='container'>
    <div class='app-row m-20-t'>
      <span class="title bold width-120">分销员类型名称:</span>
      <el-input class='flex-1' v-model="name_value"></el-input>
    </div>
    <div class="app-row j-c-c m-100-t">
      <el-button type="success" @click="edit_button">确认修改</el-button>
    </div>
  </div>
</template>

<script>
  import experts_category_request from "@/api/experts_category_request"
  export default {
    name: 'experts_category_edit',
    data() {
      return {
        name_value: "",
      }
    },
    created() {
      this.get_detail(this.$route.query.id)
    },
    mounted() {
  
    },
    methods: {
      edit_button() {
        let params = {
          id: this.$route.query.id,
          name: this.name_value,
        }
        experts_category_request.edit_experts_category(params, res=> {
          this.$router.push('/experts/experts_category')
        })
      },
      get_detail(id) {
        experts_category_request.detail_experts_category({id}, res=> {
          let result = res.data
          this.name_value = result.name 
        })
      }
    }
  }
</script>

<style scoped>
@import "~@/styles/layout.scss";
</style>